<style type="text/css">
#status_product_image_upload{
	background:url(./images/pbar-ani.gif);
	height:15px;	
	width:200px;
	position:absolute;
	z-index:99999;
	display:none;
}
#dialog-overlay {
	width:100%; 
	height:100%;
	filter:alpha(opacity=50); 
	-moz-opacity:0.5; 
	-khtml-opacity: 0.5; 
	opacity: 0.5; 
	background:#000; 
	position:absolute; 
	top:0; left:0; 
	z-index:3000; 
	display:none;
}


#dialog-box {
	-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
	-moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
	
	-moz-border-radius: 5px;
    -webkit-border-radius: 5px;
	
	background:#eee;
	width:820px; 
	position:absolute; 
	z-index:5000; 
	display:none;
}
#dialog-box_filter {
	-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
	-moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
	-moz-border-radius: 5px;
    -webkit-border-radius: 5px;
	
	background:#eee;
	width:820px; 
	position:absolute; 
	z-index:5000; 
	display:none;
}

#dialog-box .dialog-content {
	/* style the content */
	text-align:left; 
	padding:5px; 
	margin:5px;
	color:#666; 
	font-family:arial;
	font-size:12px; 
}
#dialog-box_filter .dialog-content_filter {
	text-align:left; 
	padding:5px; 
	margin:5px;
	color:#666; 
	font-family:arial;
	font-size:12px; 
}
a.button {
	/* styles for button */
	margin:10px auto 0 auto;
	text-align:center;
	background-color: #e33100;
	display: block;
	width:50px;
	padding: 5px 10px 6px;
	color: #fff;
	text-decoration: none;
	font-weight: bold;
	line-height: 1;
	
	/* css3 implementation :) */
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
	-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
	text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
	border-bottom: 1px solid rgba(0,0,0,0.25);
	position: relative;
	cursor: pointer;
	
}

a.button:hover {
	background-color: #c33100;	
}

/* extra styling */
#dialog-box .dialog-content p {
	font-weight:700; margin:0;
}

#dialog-box .dialog-content ul {
	margin:0px; 
	padding:0; 
	height:50px;
}

	.ulfilter{
		margin:0px; padding:0px;
		width:260px;
		margin:0 auto;
		margin-top:5px;
		border:solid 1px #CCC;
		border-bottom:none;
		-webkit-border-radius:3px 3px 0px 0px;
		-moz-border-radius:3px 3px 0px 0px;
		-ms-border-radius:3px 3px 0px 0px;
		-o-border-radius:3px 3px 0px 0px;
		border-radius:3px 3px 0px 0px;
	}
	.ulfilter li{
		list-style:none;	
		border-bottom:solid 1px #CCC;
		line-height:22px;
		padding-left:5px;
		padding-right:5px;
	}
	.ulfilter li.cat{
		background-color:#ccc;	
		font-weight:bold;
	}
#tablefilter, #tablefilter tr, #tablefilter td{
	border:none;	
}
#tablefilter td{
	border:solid 1px #CCC;	
}
#subtablefilter, #subtablefilter tr, #subtablefilter td{
	border:0px;	
}
.textboxfilter{
	width:300px;	
	border:solid 1px #CCC;
}
.thungrac{
	background:url(./images/trash.png) no-repeat bottom;
	width:16px;
	height:16px;
	 float:right;
	 padding-top:3px;
	 margin-left:5px;
}
.edittool{
	 background:url(./images/tools.png) no-repeat bottom;
	width:16px;
	height:16px;
	 float:right;
	 padding-top:3px;
}
.load_filter{
		width:260px;
		margin:0px;
		padding:0px;
		margin-top:5px;
		border:solid 1px #CCC;
		border-bottom:none;
		-webkit-border-radius:3px 3px 0px 0px;
		-moz-border-radius:3px 3px 0px 0px;
		-ms-border-radius:3px 3px 0px 0px;
		-o-border-radius:3px 3px 0px 0px;
		border-radius:3px 3px 0px 0px;
		float:left;
		margin-left:10px;
}
.load_filter li{
	list-style:none;
	display:inherit;
	line-height:22px;
	padding-left:5px;
	border-bottom:solid 1px #CCC;	
}
.load_filter li.cat{
	background-color:#ccc;	
		font-weight:bold;	
	
}
.status{
	background:url(./images/imgLoading.gif) no-repeat;
	height:32px;
	width:32px;	
	position:absolute;
	margin:0 auto;
}
</style>
 <!-- path page -->
 <div id="boxpathpage" style="margin:0px;">
    	<div style="float:left; width:600px;"><img src="images/home.png" width="24" height="24" style="margin-right:5px;" align="left" />
        <div style="padding-top:7px;">{pathpage}</div>
</div>
       <div style="float:right; width:150px; border:solid 0px; padding-top:3px"> 
      		<a href="?page={par_page}&amp;pid={pid}&amp;code=01" class="tip" title="Thêm mới {cat_name}"><img src="./images/folder-add1.png" width="24" height="24" border="0" style="margin-right:5px" /></a>
      		<a href="?page={par_page}&code=11&pid={pid}&pitem={pitem}"  class="tip" title="Thêm mới {item_name}"><img src="./images/docs-add1.png" width="24" height="24" border="0" style="margin-right:5px"/></a>
      </div>
    </div>
 <!-- end path page -->
     <div style="clear:both; height:10px;"></div>
      <!--START BLOCK : msg -->
		<div>
		{msg}		</div>
        <div style="clear:both; height:10px;"></div>
		<!--END BLOCK : msg -->
    <!-- START BLOCK : addnew_cat -->
   
    <div id="titlepage">
        	<div style="float:left"><img src="images/folder-add1.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Thêm mới {cat_name}</div>
    </div>
    <div style="clear:both"></div>
    <table width="100%" border="0" class="tableadmin">
   
	    <tr>
	      <td width="150"  colspan="2" style="padding:10px;">
          <form  name="form1" method="post" action="?page={par_page}&pid={pid}&code=02" id="addnewform" onsubmit="return check_null_addnew_category()" enctype="multipart/form-data">
          <div id="borderform" style="width:800px;">
	        <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" class="tableadminform" >
	          <tr class="titletable">
	            <th colspan="2">&nbsp;</th>
	            </tr>
	          <tr>
	            <td width="150"><strong>Tên {cat_name}</strong></td>
	            <td><input type="text" name="name" id="name" class="textbox" value="{name}"/></td>
	            </tr>
	          <tr>
	            <td><strong>Thuộc mục</strong></td>
	            <td>{parentid}</td>
	            </tr>
	          <tr>
	            <td><strong>Ảnh đại diện</strong></td>
	            <td><input type="file" name="image" /></td>
              </tr>
              <tr>
	            <td><strong>Keywords</strong></td>
	            <td><textarea name="keyword" id="keyword"  rows="5" class="textarea">{keyword}</textarea></td>
	            </tr>
	          <tr>
	            <td><strong>Description</strong></td>
	            <td><textarea name="description" id="description" class="textarea" rows="5">{description}</textarea></td>
	            </tr>
	          <tr>
	            <td><strong>Thứ tự</strong></td>
	            <td><input type="text" name="thu_tu" id="thu_tu" class="orderbox" value="{thu_tu}" /></td>
	            </tr>
	          <tr>
	            <td><strong>Kích hoạt</strong></td>
	            <td><input type="checkbox" name="active" id="active" checked="checked" value="1"/></td>
	            </tr>
                <tr>
	            <td><strong>Sản phẩm chỉ hiển thị thông tin khác</strong></td>
	            <td><input type="checkbox" name="showinfofix" id="showinfofix"  value="1"/></td>
	            </tr>
	          <tr>
	            <td>&nbsp;</td>
	            <td>
                <input type="submit" name="button2" id="button2" value="Chấp nhận" class="btnadmin"/>
                <input name="cancel" type="button" value="Bỏ qua" onclick="window.location='?page={par_page}&pid={pid}&code=00'" class="btnadmin"/>
                </td>
	            </tr>
	          </table>
      </div>
              <script language="javascript">
              		
						function check_null_addnew_category(){
							if($('#addnewform #name').val()==''){
								alert('Bạn phải nhập vào tiêu tên mục');
								$('#addnewform #name').focus();
								return false;								
							}
						}
					
              </script>
	        </form></td>
	      
	      </tr>
        
        </table>
    <div style="clear:both; height:5px;"></div>
    <!-- end new category -->
    <!-- END BLOCK : addnew_cat -->
    
    <!-- START BLOCK : update_cat -->

    <div id="titlepage">
        	<div style="float:left"><img src="images/folder-add1.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Thêm mới {cat_name}</div>
    </div>
    <div style="clear:both"></div>
    <table width="100%" border="0" class="tableadmin">
   
	    <tr>
	      <td width="150"  colspan="2" style="padding:10px;">
          <form  name="form1" method="post" action="?page={par_page}&pid={pid}&code=04&id={id}&p={p}&pitem={pitem}" id="addnewform" onsubmit="return check_null_addnew_category()" enctype="multipart/form-data">
          <div id="borderform" style="width:500px;">
	        <table width="500" border="0" align="center" cellpadding="0" cellspacing="0" class="tableadmin">
	          <tr class="titletable">
	            <th colspan="2">&nbsp;</th>
	            </tr>
	          <tr>
	            <td width="150"><strong>Tên {cat_name}</strong></td>
	            <td><input type="text" name="name" id="name" class="textbox" value="{name}"/></td>
	            </tr>
	          <tr>
	            <td><strong>Thuộc {cat_name}</strong></td>
	            <td>{parentid}</td>
	            </tr>
                <tr>
	            <td><strong>Ảnh đại diện</strong></td>
	            <td>{image}<input type="file" name="image" /></td>
              </tr>
	          <tr>
	            <td><strong>Keywords</strong></td>
	            <td><textarea name="keyword" id="keyword"  rows="5" class="textarea">{keyword}</textarea></td>
	            </tr>
	          <tr>
	            <td><strong>Description</strong></td>
	            <td><textarea name="description" id="description" class="textarea" rows="5">{description}</textarea></td>
	            </tr>
	          <tr>
	            <td><strong>Thứ tự</strong></td>
	            <td><input type="text" name="thu_tu" id="thu_tu" class="orderbox" value="{thu_tu}" /></td>
	            </tr>
                <tr>
	            <td><strong>Sản phẩm chỉ hiển thị thông tin khác</strong></td>
	            <td><input type="checkbox" name="showinfofix" id="showinfofix"  value="1" {showinfofix}/></td>
	            </tr>
	          <tr>
	            <td><strong>Kích hoạt</strong></td>
	            <td><input type="checkbox" name="active" id="active" checked="checked" value="1"/></td>
	            </tr>
	          <tr>
	            <td>&nbsp;</td>
	            <td><input type="submit" name="button2" id="button2" value="Chấp nhận" class="btnadmin"/>
               <input name="cancel" type="button" value="Bỏ qua" onclick="window.location='?page={par_page}&pid={pid}&code=00'" class="btnadmin"/></td>
	            </tr>
	          </table>
              </div>
              <script language="javascript">
              		
						function check_null_addnew_category(){
							if($('#addnewform #name').val()==''){
								alert('Bạn phải nhập vào tiêu tên mục');
								$('#addnewform #name').focus();
								return false;								
							}
						}
					
              </script>
	        </form></td>
	      
	      </tr>
        
        </table>
    <div style="clear:both; height:5px;"></div>
    <!-- end update category -->
    <!-- END BLOCK : update_cat -->
    
    
    <!-- START BLOCK : addnew_item -->
    <!-- add new item -->
    <div id="titlepage">
        	<div style="float:left"><img src="images/folder-add1.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Thêm mới {item_name}</div>
    </div>
    <div style="clear:both"></div>
    <table width="100%" border="0" class="tableadmin">
    <!-- addnew category form -->
	    <tr>
	      <td width="150"  colspan="2" style="padding:10px;">
          <div id="borderform" style="width:800px;">
         
          <form  name="form1" method="post" action="?page={par_page}&code=12&pid={pid}" id="addnewitem" onsubmit="return check_null_addnew_item()" enctype="multipart/form-data">
	        <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" class="tableadmin" >
	          <tr class="titletable">
	            <th colspan="2">&nbsp;</th>
	            </tr>
	          <tr>
	            <td width="150"><strong>Tên {item_name}</strong></td>
	            <td><input type="text" name="name" id="name" class="textbox" value="{name}" /></td>
	            </tr>
              <tr>
	            <td><strong>Thuộc mục</strong></td>
	            <td>{parentid}</td>
	            </tr>
	          <tr>
	            <td><strong>Hình ảnh đại diện</strong></td>
	            <td>
                <input type="file" name="image"  id="image" /></td>
	            </tr>
	          <tr>
	            <td colspan="2"><strong>THÔNG SỐ KỸ THUẬT</strong></td>
              </tr>
	          <tr>
	            <td><strong>Chất liệu</strong></td>
	            <td><input type="text" name="chatlieu" id="chatlieu" class="textbox" value="{chatlieu}" /></td>
              </tr>
	          <tr>
	            <td><strong>Kích thước</strong></td>
	            <td><input type="text" name="kichthuoc" id="kichthuoc" class="textbox" value="{kichthuoc}" /></td>
              </tr>
	          <tr>
	            <td><strong>Cổng giao tiếp</strong></td>
	            <td><input type="text" name="conggiaotiep" id="conggiaotiep" class="textbox" value="{conggiaotiep}" /></td>
              </tr>
	          <tr>
	            <td><strong>Làm mát</strong></td>
	            <td><input type="text" name="lammat" id="lammat" class="textbox" value="{lammat}" /></td>
              </tr>
	          <tr>
	            <td><strong>Công nghệ sơn</strong></td>
	            <td><input type="text" name="congngheson" id="congngheson" class="textbox" value="{congngheson}" /></td>
              </tr>
	          <tr>
	            <td><strong>Khay ổ</strong></td>
	            <td><input type="text" name="khayo" id="khayo" class="textbox" value="{khayo}" /></td>
              </tr>
	          <tr>
	            <td><strong>Nguồn</strong></td>
	            <td><input type="text" name="nguon" id="nguon" class="textbox" value="{nguon}" /></td>
              </tr>
	          <tr>
	            <td><strong>Thông tin khác</strong></td>
	            <td>&nbsp;</td>
	            </tr>
	          <tr>
	            <td colspan="2">{content}</td>
	            </tr>
	          <tr>
	            <td><strong>Thứ tự</strong></td>
	            <td><input type="text" name="thu_tu" id="thu_tu" class="orderbox" value="{thu_tu}"/></td>
	            </tr>
	          <tr>
	            <td><strong>Sản phẩm mới</strong></td>
	            <td><input type="checkbox" name="moi" id="moi" value="1" {moi}/></td>
              </tr>
	          <tr>
	            <td><strong>Kích hoạt</strong></td>
	            <td><input type="checkbox" name="active" id="active" checked="checked" value="1"/></td>
	            </tr>
	          <tr>
	            <td valign="top"><strong>Thuộc nhóm lọc</strong></td>
	            <td>
                	<div id="load_filter_addnew">
                    
                    </div>
                </td>
              </tr>
	          <tr>
	            <td>&nbsp;</td>
	            <td><input type="submit" name="button2" id="button2" value="Chấp nhận" class="btnadmin"/>
                <input name="cancel" type="button" value="Bỏ qua" onclick="window.location='?page={par_page}&pid={pid}&code=00'" class="btnadmin"/>
                </td>
	            </tr>
	          </table>
              <script language="javascript">
              		
						function check_null_addnew_item(){
							if($('#addnewitem #name').val()==''){
								alert('Bạn phải nhập vào tên bài viết');
								$('#addnewitem #name').focus();
								return false;								
							}
						}
					
              </script>
	        </form>
            </div>
            </td>
	      
	      </tr>
           <!--end  addnew category form -->
      
        </table>
    <div style="clear:both; height:5px;"></div>
    <!-- END BLOCK : addnew_item -->
    
    
    
    <!-- START BLOCK : update_item -->
    <!-- add new item -->
    <div id="titlepage">
        	<div style="float:left"><img src="images/folder-add1.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Sửa chữ {item_name}</div>
    </div>
    <div style="clear:both"></div>
    <table width="100%" border="0" class="tableadmin">
   
	    <tr>
	      <td width="150"  colspan="2" style="padding:10px;">
          <div id="borderform" style="width:800px;">
         
          <form  name="form1" method="post" action="?page={par_page}&code=14&pid={pid}&id={id}&p={p}&pitem={pitem}" id="addnewitem" onsubmit="return check_null_addnew_item()" enctype="multipart/form-data">
	        <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" class="tableadmin" >
	          <tr class="titletable">
	            <th colspan="2">&nbsp;</th>
	            </tr>
	          <tr>
	            <td width="150"><strong>Tên {item_name}</strong></td>
	            <td><input type="text" name="name" id="name" class="textbox" value="{name}" /></td>
	            </tr>
	          <tr>
	            <td><strong>Thuộc mục</strong></td>
	            <td>{parentid}</td>
	            </tr>
	          <tr>
	            <td><strong>Hình ảnh đại diện</strong></td>
	            <td>
                     {image}<input type="file" name="image"  id="image" />
                </td>
	            </tr>
                <tr>
	            <td colspan="2"><strong>THÔNG SỐ KỸ THUẬT</strong></td>
              </tr>
	          <tr>
	            <td><strong>Chất liệu</strong></td>
	            <td><input type="text" name="chatlieu" id="chatlieu" class="textbox" value="{chatlieu}" /></td>
              </tr>
	          <tr>
	            <td><strong>Kích thước</strong></td>
	            <td><input type="text" name="kichthuoc" id="kichthuoc" class="textbox" value="{kichthuoc}" /></td>
              </tr>
	          <tr>
	            <td><strong>Cổng giao tiếp</strong></td>
	            <td><input type="text" name="conggiaotiep" id="conggiaotiep" class="textbox" value="{conggiaotiep}" /></td>
              </tr>
	          <tr>
	            <td><strong>Làm mát</strong></td>
	            <td><input type="text" name="lammat" id="lammat" class="textbox" value="{lammat}" /></td>
              </tr>
	          <tr>
	            <td><strong>Công nghệ sơn</strong></td>
	            <td><input type="text" name="congngheson" id="congngheson" class="textbox" value="{congngheson}" /></td>
              </tr>
	          <tr>
	            <td><strong>Khay ổ</strong></td>
	            <td><input type="text" name="khayo" id="khayo" class="textbox" value="{khayo}" /></td>
              </tr>
	          <tr>
	            <td><strong>Nguồn</strong></td>
	            <td><input type="text" name="nguon" id="nguon" class="textbox" value="{nguon}" /></td>
              </tr>
	          <tr>
	            <td><strong>Chi tiết</strong></td>
	            <td>&nbsp;</td>
	            </tr>
	          <tr>
	            <td colspan="2">{content}</td>
	            </tr>
              <tr>
	            <td><strong>Thứ tự</strong></td>
	            <td><input type="text" name="thu_tu" id="thu_tu" class="orderbox" value="{thu_tu}"/></td>
	            </tr>
                 <tr>
	            <td><strong>Sản phẩm mới</strong></td>
	            <td><input type="checkbox" name="moi" id="moi" value="1" {moi}/></td>
              </tr>
	          <tr>
	            <td><strong>Kích hoạt</strong></td>
	            <td><input type="checkbox" name="active" id="active" checked="checked" value="1"/></td>
	            </tr>
	          <tr>
	            <td valign="top"><strong>Thuộc nhóm lọc</strong></td>
	            <td><div id="load_filter_addnew">
                    {filter}
                    </div></td>
              </tr>
	          <tr>
	            <td>&nbsp;</td>
	            <td><input type="submit" name="button2" id="button2" value="Chấp nhận" class="btnadmin"/>
                <input name="cancel" type="button" value="Bỏ qua" onclick="window.location='?page={par_page}&pid={pid}&code=00'" class="btnadmin"/>
                </td>
	            </tr>
	          <tr>
	            <td>&nbsp;</td>
	            <td>&nbsp;</td>
              </tr>
	          </table>
              <script language="javascript">
              		
						function check_null_addnew_item(){
							if($('#addnewitem #name').val()==''){
								alert('Bạn phải nhập vào tên bài viết');
								$('#addnewitem #name').focus();
								return false;								
							}
						}
					
              </script>
	        </form>
            </div>
            </td>
	      
	      </tr>
           <!--end  addnew category form -->
      
        </table>
    <div style="clear:both; height:5px;"></div>
    <!-- END BLOCK : update_item -->
    
    
    <!-- end new item -->
    <!-- START BLOCK : show_category -->
    <!-- table -->
    <form name="listitem" action="?page={par_page}&pid={pid}&code=05" method="post" style="margin:0px;">
    	<div id="titlepage">
        	<div style="float:left"><img src="images/folder.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Danh sách {cat_name}</div>
            <div id="btnaddnewfolder"><a href="?page={par_page}&amp;pid={pid}&amp;code=01">Thêm mới {cat_name} </a></div>
        </div>
        <div style="clear:both"></div>
        
   	  <table width="100%" border="0" id="tablelist">
       	
     <thead>
        <tr class="searchbar">
            <th width="40"><input name="" type="checkbox" value=""  class="checkallitem" /></th>
            <th>
                <div style="float:left;">&nbsp;Tên {cat_name}</div>
                <div id="filter" style="float:right"></div>
            </th>
            <th width="60">Kích hoạt</th>
            <th width="60">Thứ tự</th>
            <th width="50">Sửa</th>
            <th width="50">Xóa</th>
        </tr>
	</thead>

   
          <!-- START BLOCK : list_cat -->
          <tr>
            <td align="center"><input name="delall[{id_category}]" type="checkbox" value="" class="selectitem" /></td>
            <td><a href="{linkcat}" id="name_filter_{id_category}"><img src="images/folder16.png" width="16" height="16" border="0" align="left" style="margin-right:5px;" />{name}</a>
            </td>
            <td width="60" align="center"><input name="active_{id_category}" type="checkbox" value="1" {active}/></td>
            <td width="60" align="center"><input type="text" name="thu_tu_{id_category}" id="thu_tu" class="orderbox" value="{thu_tu}"/></td>
            <td align="center"><a href="{link_update}"  class="tip" title="Sửa {cat_name} này"><img src="images/tools.png" border="0" /></a></td>
            <td align="center"><a href="javascript:ConfirmDeleteCat('{id_category}')"  class="tip" title="Xóa {cat_name} này"><img src="images/trash.png" border="0" /></a></td>
          </tr>
        <!-- END BLOCK : list_cat -->
         
          <tr>
            <th align="center"><input name="" type="checkbox" value=""  class="checkallitem" /></th>
            <th align="left"><a href="#" class="name"><div style="float:left" class="delall"><img src="images/icon_16_trash.png" width="24" height="24" align="absmiddle" border="0" />&nbsp;Xóa những {cat_name} đã chọn</div></a></th>
            <th colspan="2" align="center"><input type="submit" class="btnadmin" name="button" id="button" value="Cập nhật" /></th>
            <th align="center">&nbsp;</th>
            <th>&nbsp;</th>
          </tr>
      </table>
<div id="bottomtable"></div>
        </form>
        <div style="clear:both; height:10px;"></div>
       
       <!-- END BLOCK : show_category -->
       <!-- START BLOCK : show_item -->
         <!-- item -->
        <div id="titlepage">
        	<div style="float:left"><img border="0" src="images/docs.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Danh sách {item_name}</div>
            <div id="btnaddnewitem"><a href="?page={par_page}&code=11&pid={pid}&pitem={pitem}">Thêm mới {item_name} </a></div>
        </div>
         <div id="searchbar" style="margin:0px;">
        <form action="?page={par_page}&code=18" method="post" style="margin:0px; padding:0px;"	>
           <div style="float:left">&nbsp;  <input id="keyword" type="text" name="keyword" onBlur="if (keyword.value=='') keyword.value='Tên {item_name}...';" onFocus="if (keyword.value=='Tên {item_name}...') keyword.value=''" style="width:250px" value="Tên {item_name}..." class="textboxsearch"> 
            {parentid}
            </div>
         <div style="height:18px; width:28px; margin-left:10px; float:left"> <img src="images/go.jpg" width="28" height="18" align="baseline" style="margin-top:5px;" /></div>
		</form>
         </div>
         <form action="?page={par_page}&code=15&pid={pid}&pitem={pitem}&p={p}" method="post" id="list_item" style="margin:0px">
   	  <table width="100%" border="0" id="tablelist1" class="xxxxxxxxxxxxx" style="margin:0px">
       	
     <thead>
     
        <tr class="searchbar">
            <th width="40"><input name="" type="checkbox" value=""  class="checkallitem" /></th>
            <th>
                <div style="float:left; ">&nbsp;Tên {item_name}</div>
                 <div id="filter" style="float:right"></div>
            </th>
            <th width="60">Ảnh khác</th>
            <th width="60">Kích hoạt</th>
            <th width="60">Thứ tự</th>
            <th width="50">Sửa</th>
            <th width="50">Xóa</th>
        </tr>
	</thead>

    	<!-- START BLOCK : list_item -->
          <tr>
            <td align="center"><input name="delallitem[{id}]" type="checkbox" value="{id}" class="selectitem"/></td>
            <td><a href="{link_edit}">{image}&nbsp;{name}</a> 
              <div class="createdate">Tạo bởi: {user_name} [{username}] - Ngày: {creatdate}</div></td>
            <td width="60" align="center"><a href="#" onclick="popup('{id}'); return false" class="tip" title="Quản lý hình ảnh cho sản phẩm này">Quản lý</a></td>
            <td width="60" align="center"><input name="active_{id}" type="checkbox" value="1" {active}/></td>
            <td width="60" align="center"><input type="text" name="thu_tu_{id}" id="thu_tu" class="orderbox" value="{thu_tu}"/></td>
            <td align="center"><a href="{link_edit}" class="tip" title="Sửa {item_name} này"><img border="0" src="images/tools.png" /></a></td>
            <td align="center"><a href="javascript:ConfirmDeleteItem({id})"  class="tip" title="Xóa {item_name} này"><img src="images/trash.png" border="0" /></a></td>
          </tr>
        <!-- END BLOCK : list_item -->
        
          <tr class="bottomtable" >
            <th align="center"><input name="" type="checkbox" value=""  class="checkallitem tip" title="Đánh dấu tất cả" /></th>
            <th align="left"><a href="#" class="name">
            <div class="delall" style="float:left"><a href="#" onclick="return ConfirmDeleteMultiItem();"><img src="images/icon_16_trash.png" width="24" height="24" border="0" align="absmiddle" style="margin-right:5px" />Xóa những {item_name} đã chọn</div></a></th>
            <th colspan="3" align="center"><input type="submit" class="btnadmin" name="button" id="button" value="Cập nhật" /></th>
            <th align="center">&nbsp;</th>
            <th>&nbsp;</th>
          </tr>

        </table>
</form>
         <div id="pagebar" align="center">
         	<div style="margin:0 auto; text-align:center">{pages_items}</div>
         </div>
		<div id="bottomtable"></div>
        <!-- end item -->
        <!-- END BLOCK : show_item -->
    <!-- end table -->
    <script language="javascript">
		
function ConfirmDeleteCat(id)
 {
 	if(confirm('Bạn có thật sự muốn xóa không ?')){
		document.location='?page={par_page}&pid={pid}&p={p}&code=06&id='+id;
	}
	else	{
		return false;
	}
 }
 function ConfirmDeleteItem(id)
 {
 	if(confirm('Bạn có thật sự muốn xóa không ?')){
		document.location='?page={par_page}&pid={pid}&pitem={pitem}&code=16&id='+id;
	}
	else	{
		return false;
	}
 }
  function ConfirmDeleteMultiItem()
 {
	 var n=$('input.selectitem:checked').length;
	if(n>0){
		if(confirm('Bạn có thật sự muốn xóa không ?')){
			$('#list_item').attr('action','?page={par_page}&code=17&pid={pid}&pitem={pitem}');
			$('#list_item').submit();
		}
		else{
			return false;
		}
	}else{
		alert('Không có {item_name} nào được chọn!');	
	}
 }

 
</script>
<script type="text/javascript">

$(document).ready(function () {
	$('#close_box').click(function () {		
		$('#dialog-overlay, #dialog-box').hide();		
		$('#dialog-overlay, #dialog-box_filter').hide();		
		return false;
	});
	$('#close_box_filter').click(function () {		
		$('#dialog-overlay, #dialog-box_filter').hide();		
		return false;
	});
	$(window).resize(function () {
		if (!$('#dialog-box').is(':hidden')) popup();	
		if (!$('#dialog-box_filter').is(':hidden')) popup_filter();		
	});	
	
	
});

function popup(id) {
	var maskHeight = $(document).height();  
	var maskWidth = $(window).width();
	var dialogTop =  (maskHeight/2) - ($('#dialog-box').height()/2);  
	var dialogLeft = (maskWidth/2) - ($('#dialog-box').width()/2); 
	$('#dialog-overlay').css({height:maskHeight, width:maskWidth}).show();
	$('#dialog-box').css({top:dialogTop, left:dialogLeft}).show();
	$('#id_product_photo').attr('value',id);
	$('#show_image_product').load("index4.php?page=uploadimage_product&code=load&id="+id);
}

function popup_filter(id) {
	var maskHeight = $(document).height();  
	var maskWidth = $(window).width();
	var dialogTop =  (maskHeight/2) - ($('#dialog-box_filter').height()/2);  
	var dialogLeft = (maskWidth/2) - ($('#dialog-box_filter').width()/2); 
	$('#dialog-overlay').css({height:maskHeight, width:maskWidth}).show();
	$('#dialog-box_filter').css({top:dialogTop, left:dialogLeft}).show();
	$('#id_product_filter').attr('value',id);
	
	$('#name_filter_cat').text('Bộ lọc cho: '+$('#name_filter_'+id).text());
	$('#ulfilter').html('<div class="status"></div>');
	$('#ulfilter').load('index4.php?page=filter&id_product_filter='+id,function(response, status, xhr) {
			  if (status == "error") {
				var msg = "Sorry but there was an error: ";
				// $('#load_filter_addnew').html(msg + xhr.status + " " + xhr.statusText);
			  }
			  if(status=='success'){
				 $('#ulfilter .status').remove();
			 }
			
	});
	
}

</script>

<div></div>
 <div id="dialog-overlay"></div>
<div id="dialog-box">
	<div class="dialog-content">
		<div id="dialog-message">
       	  <div style="width:800px; height:500px;">
            <form action="index4.php?page=uploadimage_product" name="upload_image_product" id="upload_image_product" method="post" enctype="multipart/form-data" onsubmit="return check_submit()">
            <input type="hidden" value="addnew"  name="code" />
            <input type="hidden" name="id_product_photo" id="id_product_photo" value="" />
            	<table width="100%" border="0" cellpadding="5">
                  <tr>
                    <td colspan="2" style="border-bottom:solid 1px #CCC; text-transform:uppercase"><strong>Hình ảnh</strong></td>
                  </tr>
                  <tr>
                    <td><strong>Tên ảnh</strong></td>
                    <td><input name="name" id="name" type="text"  style="width:300px;"/></td>
                  </tr>
                  <tr>
                    <td><strong>Ảnh</strong></td>
                    <td><input type="file" name="productimage" id="productimage" />
                    <input type="submit" name="button3" id="button3" value="Tải ảnh" /></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td><div style="position:relative" >
                    		<div id="showmes"></div>
                          <div id="status_product_image_upload"></div>
                        </div></td>
                  </tr>
                  <tr>
                    <td colspan="2">                   
                    <div id="show_image_product" >
                    </div>
                    </td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                </table>
            </form>
            </div>
        </div>
		<a href="#" class="button" id="close_box">Đóng</a>
	</div>
</div>

<div id="dialog-box_filter">
	<div class="dialog-content_filter">
		<div id="dialog-message_filter">
       	  <div style="width:800px; height:400px; overflow:auto" >
            <form action="index4.php?page=filter" name="catpd_filter" id="catpd_filter" method="post" enctype="multipart/form-data" >
            <input type="hidden" value="addnew"  name="code" />
            <input type="hidden" name="id_product_filter" id="id_product_filter" value="" />
            <div id="name_filter_cat" style="font-weight:bold; color:#FF0000"></div>
           
            	<table width="100%" border="1" id="tablefilter">
                              <tr>
                                <td valign="top" style="width:60%">
                                	<div  id="show_form_filter">
                                  		  <table width="100%" border="0" id="subtablefilter">
                                      <tr >
                                        <td><strong>Tên nhóm</strong></td>
                                        <td align="center" style="width:60px;"><strong>Thứ tự</strong></td>
                                        <td align="center" style="width:60px;"><strong>&nbsp;</strong></td>
                                      </tr>
                                       <tr id="cls_tr_filter_cat">
                                        <td><input type="text" name="lable_filter_cat"  class="textboxfilter" value="{name}"/></td>
                                        <td><input type="text" name="order_filter_cat" id="order_filter_cat" class="orderbox" value="0" /></td>
                                        <td align="center">&nbsp;</td>
                                      </tr>
                                      <tr >
                                        <td><strong>Nhãn</strong></td>
                                        <td align="center" style="width:60px;"><strong>Thứ tự</strong></td>
                                        <td align="center" style="width:60px;"><strong>Xóa</strong></td>
                                      </tr>
                                     
                                      <tr id="cls_tr_filter_1">
                                        <td><input type="text" name="lable_filter_1"  class="textboxfilter" value="{name}"/></td>
                                        <td><input type="text" name="order_filter_1" id="order_filter" class="orderbox" value="1" /></td>
                                        <td align="center">&nbsp;</td>
                                      </tr>
                                      <tr id="cls_tr_filter_2">
                                        <td><input type="text" name="lable_filter_2"  class="textboxfilter" value="{name}"/></td>
                                        <td><input type="text" name="order_filter_2" id="order_filter" class="orderbox" value="2" /></td>
                                        <td align="center">&nbsp;</td>
                                      </tr>
                                     
                                    </table>
                                    </div>
                                    <div><input type="button" name="btnadd_filter" id="btnadd_filter" value="Thêm" />
                                        <input type="submit" name="btnsave_filter" id="btnsave_filter" value="Lưu" /></div>
                                    </div>
                                </td>
                                <td valign="top" style="width:38%">
                                    <div id="ulfilter" ></div>
                                    <div id="status_product_image_upload" class="listatusshow"></div>
                                    <div style="clear:both; height:5px;"></div>
                                </td>
                              </tr>
                            </table>
                            <input type="hidden" name="ncount" id="ncount" value="2" />
           
            </form>
            </div>
        </div>
		<a href="#" class="button" id="close_box_filter">Đóng</a>
	</div>
</div>

<script language="javascript">
	$(document).ready(function(){
		$('#catpd_filter #btnadd_filter').click(function(){
			var n=$('#subtablefilter tr').length-2;
			$('<tr id="cls_tr_filter_'+n+'"><td><input type="text" name="lable_filter_'+n+'"  class="textboxfilter" value=""/></td><td><input type="text" name="order_filter_'+n+'" id="order_filter" class="orderbox" value="'+n+'" /></td> <td align="center"><a href="javascript:remove_tr_filter(\'cls_tr_filter_'+n+'\')" class="deletetraddfilter">Xóa</a></td></tr>').insertAfter('#subtablefilter tr:last');
			$('#ncount').attr('value',n);
		});
		//$('#load_filter_addnew').load('index4.php?page=filter&code=load_filter&id_product_filter={pid}');
		
	});
	function load_filter_addnew(id){
		$('#load_filter_addnew').html('<div class="status"></div>');
		$('#load_filter_addnew').load('index4.php?page=filter&code=load_filter&id_filter_product={id_filter_product}&id_product_filter='+id,function(response, status, xhr) {
				  if (status == "error") {
					var msg = "Sorry but there was an error: ";
					// $('#load_filter_addnew').html(msg + xhr.status + " " + xhr.statusText);
				  }
				  if(status=='success'){
					 $('#load_filter_addnew .status').remove();
				 }
		});
	}
	function load_filter_update(id){
		$('#show_form_filter').html('<div class="status"></div>');
		$('#show_form_filter').load('index4.php?page=filter&code=update&id='+id,function(response, status, xhr) {
		  if (status == "error") {
			var msg = "Sorry but there was an error: ";
			 $('#show_form_filter').html(msg + xhr.status + " " + xhr.statusText);
		  }
		  if(status=='success'){
			 $('#show_form_filter .status').remove();
		 }
		});
	}
	function remove_tr_filter(abc){
		$('#'+abc).remove();
	}
	function delete_filter(id){
		if(confirm('Bạn có thật sự muốn xóa không ?')){
			$('#ulfilter').load('index4.php?page=filter&code=delete&id='+id+'&id_product_filter='+$('#id_product_filter').val());
		}else{
			return false;	
		}
	}
	function check_submit(){
		if($('#productimage').val()==''){
			alert('Bạn phai chọn file ảnh cần upload!')	;
			$('#productimage').focus();
			return false;
		}	
	}
	$('#upload_image_product').ajaxForm({
			beforeSubmit: function(a,f,o) {
				o.dataType = 'html';
				$('#status_product_image_upload').show();
			},
			success: function(data) {	
			 $('#status_product_image_upload').hide();
				$('#show_image_product').append(data);
			},
			resetForm: true
		});
		function deleteimage_product(id){
			if(confirm('Bạn có thật sự muốn xóa không ?')){
				$('#image_product_'+id).load("index4.php?page=uploadimage_product&code=delete&id="+id);
				$('#image_product_'+id).remove();
			}else{
				return false;	
			}
		}
	$('#catpd_filter').ajaxForm({
		beforeSubmit: function(a,f,o) {
			o.dataType = 'html';
			$('.listatusshow').show();
		},
		success: function(data) {	
		 $('.listatusshow').hide();
			$('#ulfilter').html(data);
		},
		resetForm: true
	});	

</script>